Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FDC3 For Web Browsers Implementation #1309

Merged
merged 841 commits into from
Feb 12, 2025
Merged

FDC3 For Web Browsers Implementation #1309

merged 841 commits into from
Feb 12, 2025

Conversation

robmoffat
Copy link
Member

@robmoffat robmoffat commented Aug 5, 2024

Implementation PR for FDC3 for the Web (#896)

This PR primarily implements the getAgent() function (in the fdc3-get-agent package) as defined by the FDC3 Web Connection Protocol (WCP) and a DesktopAgentProxy (in the fdc3-agent-proxy package) that it uses to implement communication with browser-based Desktop Agents via the FDC3 Desktop Agent Communication Protocol (DACP).

Additionally, the FDC3 repository is refactored to be a monorepo supported by npm workspaces. The existing repository was split into fdc3-context (context type definitions), fdc3-schems (bridging and DACP protocol messages) and fdc3-standard (existing API TypeScript definitions, Intents and App Directory) packages. A testing package was added with tooling used in multiple packages for testing.

These packages are rolled up for release on NPM by an fdc3 package (publishing to the existing @finos/fdc3 NPM package). Previous releases provided both ES6 and CommonJs modules within a single package - this release will only provide ES6, with a separate fdc3-commonjs module provided for backwards compatibility (will release at @finos/fdc3-commonjs).

Finally, a reference implementation, demo for FDC3 in a Web Browser and reference channel selector and intent resolver UIs (that can be injected into an app by getAgent) are provided in the toolbox/fdc3-for-web package.

@julianna-ciq

This comment was marked as outdated.

Copy link
Contributor

@julianna-ciq julianna-ciq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing the addon and fdc3-agent-proxy package. More reviews to come...

package.json Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
packages/addon/index.html Outdated Show resolved Hide resolved
packages/addon/package.json Outdated Show resolved Hide resolved
packages/addon/src/intent_resolver.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@julianna-ciq julianna-ciq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviews for the fdc3-get-agent package

packages/fdc3-context/package.json Outdated Show resolved Hide resolved
packages/fdc3-context/package.json Outdated Show resolved Hide resolved
packages/fdc3-get-agent/package.json Outdated Show resolved Hide resolved
packages/fdc3-get-agent/test/support/MockFDC3Server.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@kriswest kriswest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just starting a review - have only really got through addon

package.json Show resolved Hide resolved
package.json Show resolved Hide resolved
package.json Show resolved Hide resolved
packages/README.md Outdated Show resolved Hide resolved
packages/addon/index.html Outdated Show resolved Hide resolved
packages/addon/src/channel_selector.ts Outdated Show resolved Hide resolved
packages/addon/src/intent_resolver.ts Outdated Show resolved Hide resolved
packages/addon/src/main.ts Outdated Show resolved Hide resolved
packages/fdc3-agent-proxy/package.json Outdated Show resolved Hide resolved
packages/fdc3-agent-proxy/package.json Outdated Show resolved Hide resolved
@kriswest

This comment was marked as outdated.

@robmoffat

This comment was marked as outdated.

@kriswest

This comment was marked as outdated.

@finos finos deleted a comment from github-actions bot Nov 5, 2024
Copy link

github-actions bot commented Nov 5, 2024

Coverage Report

Commit: 61c5a2b
Base: main@4b74dec

Type Base This PR
Total Statements Coverage  97.41%  97.41% (+0%)
Total Branches Coverage  86.53%  86.53% (+0%)
Total Functions Coverage  96.85%  96.85% (+0%)
Total Lines Coverage  97.43%  97.43% (+0%)
Details (changed files)
FileStatementsBranchesFunctionsLines
packages/fdc3-agent-proxy/src/DesktopAgentProxy.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/index.ts 100% 100% 62.5% 100%
packages/fdc3-agent-proxy/src/apps/DefaultAppSupport.ts 88% 50% 100% 88%
packages/fdc3-agent-proxy/src/channels/DefaultChannel.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/channels/DefaultChannelSupport.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/channels/DefaultPrivateChannel.ts 97.29% 66.66% 100% 97.29%
packages/fdc3-agent-proxy/src/heartbeat/DefaultHeartbeatSupport.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/intents/DefaultIntentResolution.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/intents/DefaultIntentSupport.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/AbstractListener.ts 100% 60% 100% 100%
packages/fdc3-agent-proxy/src/listeners/DefaultContextListener.ts 100% 90% 100% 100%
packages/fdc3-agent-proxy/src/listeners/DefaultIntentListener.ts 100% 77.77% 100% 100%
packages/fdc3-agent-proxy/src/listeners/EventListener.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/HeartbeatListener.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/PrivateChannelEventListener.ts 93.33% 72.72% 100% 93.33%
packages/fdc3-agent-proxy/src/messaging/AbstractMessaging.ts 94.59% 100% 80% 94.59%
packages/fdc3-agent-proxy/src/util/AbstractFDC3Logger.ts 100% 94.11% 100% 100%
packages/fdc3-agent-proxy/src/util/Logger.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/util/throwIfUndefined.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/index.ts 100% 100% 28.57% 100%
packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/messaging/message-port.ts 97.43% 86.66% 100% 97.43%
packages/fdc3-get-agent/src/sessionStorage/DesktopAgentDetails.ts 97.36% 89.47% 100% 97.36%
packages/fdc3-get-agent/src/strategies/DesktopAgentPreloadLoader.ts 100% 81.25% 100% 100%
packages/fdc3-get-agent/src/strategies/FailoverHandler.ts 100% 76.47% 100% 100%
packages/fdc3-get-agent/src/strategies/HelloHandler.ts 94% 81.25% 100% 94%
packages/fdc3-get-agent/src/strategies/IdentityValidationHandler.ts 95.65% 73.33% 100% 95.65%
packages/fdc3-get-agent/src/strategies/PostMessageLoader.ts 98.48% 86.95% 100% 98.46%
packages/fdc3-get-agent/src/strategies/Timeouts.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/strategies/getAgent.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/ui/AbstractUIComponent.ts 97.14% 71.42% 100% 97.01%
packages/fdc3-get-agent/src/ui/DefaultDesktopAgentChannelSelector.ts 100% 75% 100% 100%
packages/fdc3-get-agent/src/ui/DefaultDesktopAgentIntentResolver.ts 100% 90% 100% 100%
packages/fdc3-get-agent/src/ui/NullChannelSelector.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/ui/NullIntentResolver.ts 100% 100% 66.66% 100%
packages/fdc3-get-agent/src/util/Logger.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/util/Uuid.ts 100% 100% 100% 100%
packages/fdc3-standard/src/index.ts 100% 100% 0% 100%
packages/fdc3-standard/src/api/Errors.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/GetAgent.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Methods.ts 94.04% 84.05% 96.29% 95%
packages/fdc3-standard/src/api/RecommendedChannels.ts 100% 100% 100% 100%
packages/fdc3-standard/src/context/ContextType.ts 100% 100% 100% 100%
packages/fdc3-standard/src/intents/Intents.ts 100% 100% 100% 100%
packages/fdc3-standard/src/internal/contextConfiguration.ts 100% 100% 100% 100%
packages/fdc3-standard/src/internal/intentConfiguration.ts 100% 100% 100% 100%
packages/fdc3-standard/src/internal/typeHelpers.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/BasicFDC3Server.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/ServerContext.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/directory/BasicDirectory.ts 96.87% 84.21% 100% 96.55%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/BroadcastHandler.ts 96.38% 86.41% 100% 96.12%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/HeartbeatHandler.ts 88.23% 71.87% 86.66% 90%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/IntentHandler.ts 95.6% 86.56% 100% 95%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/OpenHandler.ts 97.14% 86.84% 100% 97.14%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/support.ts 100% 100% 100% 100%
Details (all files)
FileStatementsBranchesFunctionsLines
packages/fdc3-agent-proxy/src/DesktopAgentProxy.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/index.ts 100% 100% 62.5% 100%
packages/fdc3-agent-proxy/src/apps/DefaultAppSupport.ts 88% 50% 100% 88%
packages/fdc3-agent-proxy/src/channels/DefaultChannel.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/channels/DefaultChannelSupport.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/channels/DefaultPrivateChannel.ts 97.29% 66.66% 100% 97.29%
packages/fdc3-agent-proxy/src/heartbeat/DefaultHeartbeatSupport.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/intents/DefaultIntentResolution.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/intents/DefaultIntentSupport.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/AbstractListener.ts 100% 60% 100% 100%
packages/fdc3-agent-proxy/src/listeners/DefaultContextListener.ts 100% 90% 100% 100%
packages/fdc3-agent-proxy/src/listeners/DefaultIntentListener.ts 100% 77.77% 100% 100%
packages/fdc3-agent-proxy/src/listeners/EventListener.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/HeartbeatListener.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/listeners/PrivateChannelEventListener.ts 93.33% 72.72% 100% 93.33%
packages/fdc3-agent-proxy/src/messaging/AbstractMessaging.ts 94.59% 100% 80% 94.59%
packages/fdc3-agent-proxy/src/util/AbstractFDC3Logger.ts 100% 94.11% 100% 100%
packages/fdc3-agent-proxy/src/util/Logger.ts 100% 100% 100% 100%
packages/fdc3-agent-proxy/src/util/throwIfUndefined.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/index.ts 100% 100% 28.57% 100%
packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/messaging/message-port.ts 97.43% 86.66% 100% 97.43%
packages/fdc3-get-agent/src/sessionStorage/DesktopAgentDetails.ts 97.36% 89.47% 100% 97.36%
packages/fdc3-get-agent/src/strategies/DesktopAgentPreloadLoader.ts 100% 81.25% 100% 100%
packages/fdc3-get-agent/src/strategies/FailoverHandler.ts 100% 76.47% 100% 100%
packages/fdc3-get-agent/src/strategies/HelloHandler.ts 94% 81.25% 100% 94%
packages/fdc3-get-agent/src/strategies/IdentityValidationHandler.ts 95.65% 73.33% 100% 95.65%
packages/fdc3-get-agent/src/strategies/PostMessageLoader.ts 98.48% 86.95% 100% 98.46%
packages/fdc3-get-agent/src/strategies/Timeouts.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/strategies/getAgent.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/ui/AbstractUIComponent.ts 97.14% 71.42% 100% 97.01%
packages/fdc3-get-agent/src/ui/DefaultDesktopAgentChannelSelector.ts 100% 75% 100% 100%
packages/fdc3-get-agent/src/ui/DefaultDesktopAgentIntentResolver.ts 100% 90% 100% 100%
packages/fdc3-get-agent/src/ui/NullChannelSelector.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/ui/NullIntentResolver.ts 100% 100% 66.66% 100%
packages/fdc3-get-agent/src/util/Logger.ts 100% 100% 100% 100%
packages/fdc3-get-agent/src/util/Uuid.ts 100% 100% 100% 100%
packages/fdc3-standard/src/index.ts 100% 100% 0% 100%
packages/fdc3-standard/src/api/Errors.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/GetAgent.ts 100% 100% 100% 100%
packages/fdc3-standard/src/api/Methods.ts 94.04% 84.05% 96.29% 95%
packages/fdc3-standard/src/api/RecommendedChannels.ts 100% 100% 100% 100%
packages/fdc3-standard/src/context/ContextType.ts 100% 100% 100% 100%
packages/fdc3-standard/src/intents/Intents.ts 100% 100% 100% 100%
packages/fdc3-standard/src/internal/contextConfiguration.ts 100% 100% 100% 100%
packages/fdc3-standard/src/internal/intentConfiguration.ts 100% 100% 100% 100%
packages/fdc3-standard/src/internal/typeHelpers.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/BasicFDC3Server.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/ServerContext.ts 100% 100% 100% 100%
toolbox/fdc3-for-web/fdc3-web-impl/src/directory/BasicDirectory.ts 96.87% 84.21% 100% 96.55%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/BroadcastHandler.ts 96.38% 86.41% 100% 96.12%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/HeartbeatHandler.ts 88.23% 71.87% 86.66% 90%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/IntentHandler.ts 95.6% 86.56% 100% 95%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/OpenHandler.ts 97.14% 86.84% 100% 97.14%
toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/support.ts 100% 100% 100% 100%

This comment was marked as outdated.

toolbox/fdc3-for-web/demo/src/client/tsconfig.json.unused Outdated Show resolved Hide resolved
toolbox/fdc3-for-web/demo/static/dnd/index.html Outdated Show resolved Hide resolved
packages/fdc3-standard/src/api/Types.ts Outdated Show resolved Hide resolved
packages/fdc3-standard/src/ui/IntentResolver.ts Outdated Show resolved Hide resolved
packages/fdc3-standard/test/ContextTypes.test.ts Outdated Show resolved Hide resolved
packages/fdc3/src/index.ts Outdated Show resolved Hide resolved
packages/testing/src/agent/index.ts Outdated Show resolved Hide resolved
@robmoffat robmoffat changed the title FDC3 For Web Browsers Implementation DO NOT MERGE FDC3 For Web Browsers Implementation DO NOT MERGE OR REVIEW Nov 8, 2024
@robmoffat

This comment was marked as outdated.

This comment was marked as outdated.

@kriswest

This comment was marked as outdated.

This comment was marked as outdated.

@robmoffat

This comment was marked as outdated.

@robmoffat

This comment was marked as outdated.

@kriswest
Copy link
Contributor

kriswest commented Nov 8, 2024

But yes I agree - since this is the implementation of #1297 we can't close that until this is done.

At least it's helping me persuade myself to buy a bigger laptop (rendering the diff takes some doing) ;-)

It's also a huge contribution of work to the standard which will have a massive positive impact on it if you/we pull it off. Looking forward to helping get that done.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

Copy link

github-actions bot commented Nov 8, 2024

420 passed

3 similar comments
Copy link

github-actions bot commented Nov 8, 2024

420 passed

Copy link

github-actions bot commented Nov 8, 2024

420 passed

Copy link

github-actions bot commented Nov 8, 2024

420 passed

Copy link

504 passed

@kriswest kriswest self-requested a review January 29, 2025 13:18
kriswest
kriswest previously approved these changes Jan 29, 2025
Copy link
Contributor

@kriswest kriswest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM again (after fixing fdc3-workbench linter config)

julianna-ciq
julianna-ciq previously approved these changes Jan 29, 2025
novavi
novavi previously requested changes Feb 3, 2025
Copy link

@novavi novavi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see comments for issues I found.

packages/testing/package.json Show resolved Hide resolved
toolbox/fdc3-for-web/demo/package.json Show resolved Hide resolved
toolbox/fdc3-for-web/demo/package.json Show resolved Hide resolved
website/docs/api/specs/browserResidentDesktopAgents.md Outdated Show resolved Hide resolved
website/docs/api/specs/preloadDesktopAgents.md Outdated Show resolved Hide resolved
website/docs/api/specs/webConnectionProtocol.md Outdated Show resolved Hide resolved
website/docs/api/specs/browserResidentDesktopAgents.md Outdated Show resolved Hide resolved
@kriswest
Copy link
Contributor

kriswest commented Feb 5, 2025

@robmoffat are you ok to own resolving @novavi's comments? I shouldn't push currently as that will invalidate review and cause some CLA issues)

@bingenito
Copy link
Member

@robmoffat are you ok to own resolving @novavi's comments? I shouldn't push currently as that will invalidate review and cause some CLA issues)

I can go through a bunch and add these tomorrow. It can be a good way to help participate in this PR as I'm limited in what I can review.

@robmoffat
Copy link
Member Author

@robmoffat are you ok to own resolving @novavi's comments? I shouldn't push currently as that will invalidate review and cause some CLA issues)

I can go through a bunch and add these tomorrow. It can be a good way to help participate in this PR as I'm limited in what I can review.

awesome thanks Brian

@bingenito bingenito dismissed stale reviews from julianna-ciq and kriswest via be2d328 February 6, 2025 13:36
Copy link

github-actions bot commented Feb 6, 2025

504 passed

Copy link

github-actions bot commented Feb 6, 2025

504 passed

Copy link
Contributor

@kriswest kriswest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@robmoffat
Copy link
Member Author

@novavi can you please check @bingenito's commits fix your outstanding review issues and we can get this merged?

thanks,
Rob

@kriswest kriswest dismissed novavi’s stale review February 12, 2025 14:32

Agreed at Maintainers meeting 12/02/25 that all requested changes had been applied and that we should go ahead and merge

@kriswest kriswest merged commit 97f9809 into main Feb 12, 2025
9 checks passed
@kriswest kriswest deleted the fdc3-for-web-impl branch February 12, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment